package com.example.demo.controller;

import com.example.demo.Service.ICarouselService;
import com.example.demo.core.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/carousel")
@CrossOrigin(origins = "*")
public class CarouselController {

    @Autowired
    private ICarouselService carouselService;

    @GetMapping()
    public Result list(){
        return Result.success(carouselService.list());
    }
}
